//
//  HomeSimpleImageCell.swift
//  BA_MARRY_SWIFT
//
//  Created by 王洋 on 2021/6/4.
//

import UIKit

class HomeSimpleImageCell: UITableViewCell {

    public static func calculateHeight() -> CGFloat{
        return UIScreen.main.bounds.size.width*0.093;
    }
    
    lazy var mainImageView : UIImageView = {
        let imgv = UIImageView.init()
        return imgv
    }()
    
    func fillCellWithModel(model:HomeADItemModel)  {
        let url = URL(string: model.sysAdvertisement?.sysAdvEventList.first?.url ?? "")
        self.mainImageView.kf.setImage(with: url)
    }
        
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.contentView.backgroundColor = UIColor.white
        self.addSubview(self.mainImageView)
        self.mainImageView.snp.makeConstraints { make in
            make.left.equalTo(0)
            make.right.equalTo(0)
            make.top.equalTo(0)
            make.bottom.equalTo(0)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    

}
